﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Blockey.GameObjects3D
{
    public class Rink : DrawableModel
    {
        public Rink(GraphicsDevice oGraphics, ContentManager oManager)
            : base(oGraphics, oManager, "Models\\IceRink\\GenericHockeyRink", true)
        {
            var oX = 60f;
            var oY = 25f;
            var oRadius = 16;
            var oMax = new Vector3(oX, oY, oRadius);
            var oMin = new Vector3(-oX, -oY, 0);

            m_oBoundingBox = new BoundingBox(oMin, oMax);
            m_oBoundingSpheres = new List<BoundingSphere>();

            oX = 44f;
            oY = 9f;
            m_oSphereLU = new BoundingSphere(new Vector3(-oX, oY, 0.0f), oRadius);
            m_oSphereLD = new BoundingSphere(new Vector3(-oX, -oY, 0.0f), oRadius);
            m_oSphereRU = new BoundingSphere(new Vector3(oX, oY, 0.0f), oRadius);
            m_oSphereRD = new BoundingSphere(new Vector3(oX, -oY, 0.0f), oRadius);

            m_oBoundingSpheres.Add(m_oSphereLU);
            m_oBoundingSpheres.Add(m_oSphereLD);
            m_oBoundingSpheres.Add(m_oSphereRU);
            m_oBoundingSpheres.Add(m_oSphereRD);

            SetTransformation(null, null, 2);
        }

        public BoundingBox BoundingBox
        {
            get { return m_oBoundingBox; }
        }

        public BoundingSphere BoundingSphereLU
        {
            get { return m_oSphereLU; }
        }
        public BoundingSphere BoundingSphereLD
        {
            get { return m_oSphereLD; }
        }
        public BoundingSphere BoundingSphereRU
        {
            get { return m_oSphereRU; }
        }
        public BoundingSphere BoundingSphereRD
        {
            get { return m_oSphereRD; }
        }


        BoundingBox m_oBoundingBox;
        List<BoundingSphere> m_oBoundingSpheres;
        BoundingSphere m_oSphereLU;
        BoundingSphere m_oSphereLD;
        BoundingSphere m_oSphereRU;
        BoundingSphere m_oSphereRD;

    }
}
